<?php $form = $this->beginWidget('CActiveForm', array(
	'id'=>'new-form',
	'method'=>'post',
	'enableClientValidation'=>true,
)); ?>
<table class="table table-bordered">
	<thead>
	<tr>
		<th class="span2">Date</th>
		<th>Content</th>
		<th class="span2">Actions</th>
	</tr>
	</thead>
	<tbody>
		<?php $key = "new"; ?>
		<tr>
			<td>
				<?php 
				if (!empty($item->created_date))
					$item->created_date = date('Y/m/d H:i', strtotime($item->created_date)); 
				?>
				<?php
				Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
				$this->widget('CJuiDateTimePicker',array(
					'model'=>$item, //Model object
					'attribute'=>'created_date', //attribute name
					'mode'=>'datetime', //use "time","date" or "datetime" (default)
					'language'=>'en-GB',
					'options'=>array(
						'showAnim'=>'fold',
						'showButtonPanel'=>true,
						'autoSize'=>true,
						'dateFormat'=>'yy-mm-dd',
						'changeMonth'=> true, 
						'changeYear'=> true,
						'width'=>'120',
						'separator'=>' ',
						// 'showOn' => 'button',
						// 'buttonImage'=> Yii::app()->theme->baseUrl.'/admin/images/icon_calendar_r.gif',
						// 'buttonImageOnly'=> true,
					),
					'htmlOptions' => array(
						'readonly'=>'readonly',
						'class'=>'',
						'name'=>"Notice[$key][created_date]",
					)
				)); ?>
				<?php echo $form->error($item, 'created_date'); ?>
			</td>
			<td>
				<?php echo $form->textField($item, 'content', array('name'=>"Notice[$key][content]", 'class'=>'span12')); ?>  
				<?php echo $form->error($item, 'content'); ?>
			</td>
			<td>
				<input type="submit" class="btn" value="Add" />
				<input type="hidden" name="action" value="create" />
			</td>
		</tr>
	</tbody>
</table>
<?php $this->endWidget(); ?>

<script>
//<![CDATA[
$('.btnDelete').click(function (e) {
	if(!confirm("<?php echo Yii::t('app', 'Are you sure you want to delete this item') ?>?")) {
		return e.preventDefault();
	}
});
//]]>
</script>